class ServerError extends Error {
    constructor(code, message) {
        super(message)
        this.serviceError = true;
        this.message = message;
        this.code = code;
        this.track = (new Error()).track;
    }
}

const p = Promise.all([Promise.resolve(1), Promise.reject(new ServerError('1001500001', '哈哈哈'))])

p.then((data1, data2) => {
    console.log(data1, data2)
}).catch((error => {
    if (error.code === '1001500001') {
        console.error('1001500001');
    } else {
        console.error('other')
    }
}))